Skip to content

dashboard: review pane has no exit at desk width - #102

Open
MJohnson459 wants to merge 2 commits into
mainfrom
review-pane-exit
Open

dashboard: review pane has no exit at desk width#102
MJohnson459 wants to merge 2 commits into
mainfrom
review-pane-exit

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

Review is a mode, not a fourth column: opening it stands every other pane down at every width. Below 760 px the tab bar takes you back, but above it the tab bar is display: none and a tab click was the only thing that ever called panes.show() with another pane name — so an operator who clicked N candidates — review on a desk could escape only by resizing the window or reloading the page. Introduced with the review view (#100), inherited by the zone editor.

What changed

  • back to map in the review pane head (index.html), wired in app.mjs to panes.show('map'). Escape shares that handler, on document because the pane holds no focus of its own.
  • Both are held off while a zone edit is live, as the floor picker and the revision list already are: ReviewView.leavable() is the predicate, renderEditControls disables the button, and style.css gives it the same half-opacity the other locked controls have. An edit has no autosave; cancel is how it ends.
  • A promotion returns to the map itself, the decision the pane exists for having been made — except when the announcement failed, where the note saying so is readable only in the pane that wrote it. onPromoted therefore takes the announced flag.
  • docs/fleet/README.md §11 gains a paragraph on leaving the pane.

Verification

  • ui_test.mjs (62 pass): the review pane contains an exit control; its handler names a pane that is not this one (a show('review') on a button labelled back would look right in the markup and change nothing); Escape routes through the same handler; an edit disables it. Mutation-checked — pointing onReviewBack back at review fails the test.
  • pixi run fleet-ui-check (39/39, up from 37): at 1600 px, with the tab bar measured as display: none, the button returns to the map pane, the operations panes are displayed again (the :has mode rule has let go), re-entering works, and Escape does the same — {"width":1600,"tabs":"none","button":"map","shown":"flex","reopened":"review","escape":"map"}. Mid-edit both are refused: {"disabled":true,"pane":"review"}. A promotion lands on the map. Mutation-checked the same way: 36/37 with the fix reverted.
  • Phone pass unchanged: the tab bar is still the way between panes below 760 px.

Review is a mode, not a fourth column: opening it stands every other pane
down at every width. Below 760 px the tab bar takes you back, but above it
the tab bar is hidden and a tab click was the only thing that ever called
`show()` with another pane name — so an operator who clicked `N candidates
— review` on a desk could leave only by resizing the window or reloading
the page.

`back to map` in the review pane head, and Escape, call `panes.show('map')`.
Both are held off while a zone edit is live, as the floor picker and the
revision list already are: an edit has no autosave, and leaving would strand
it on a canvas nobody can see. A promotion returns to the map itself, the
decision the pane exists for having been made — unless the announcement
failed, where the note saying so is readable only in the pane that wrote it.

ui_test.mjs holds the exit in place: the pane has the control, its handler
names a pane that is not this one, Escape shares that handler, and an edit
disables it. browser_check.mjs drives it at 1600 px, where the tab bar
computes to `display: none`: the button returns to the map pane and the
operations panes are displayed again, re-entering works, Escape does the
same, and neither works mid-edit. 39/39 checks pass; the phone pass is
unchanged.
What the code and the check names already said did not need saying beside
them. What is left is what neither says: why 760 px decides the button
exists, why a promotion stays put when the announcement failed, the mutation
the `show('map')` assertion guards against, and why the browser check
re-enters the pane mid-flow.
Comment on lines 304 to 312
// A promotion happened in the review pane: this pane's basemap is now a
// different map, so re-resolve it rather than keep drawing the old one.
function onPromoted() {
// different map, so re-resolve it rather than keep drawing the old one. The
// review is then over — except when the announcement failed, whose note is
// readable only in the pane that wrote it.
function onPromoted(site, floor, revision, announced) {
state.mapKey = null;
scheduleRender();
if (announced) panes.show('map');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: a successful promotion navigates away before its own confirmation is visible, and lands on the wrong floor.

In promote()'s success branch, the outcome note ("<site>/<floor> is on <rev>") is written into #review-note and then this.onPromoted(site, floor, revision, Boolean(body.announced)) is called:

: `promoted, but not announced: ${body.detail}`,
!body.announced,
);
this.onPromoted(site, floor, revision, Boolean(body.announced));
} catch (error) {
this.note(error.message, true);
}

onPromoted here ignores its own site/floor args and, when announced is true, immediately calls panes.show('map'), which hides the review pane (.review-pane { display: none } in style.css) in the same tick — so the success note is written into a pane that's already hidden, and gets cleared (this.note('')) the next time review is opened. It's never seen.

Worse, the map pane doesn't re-resolve to the promoted floor: ensureMap() derives the basemap from the selected robot's pose/health site+floor, unrelated to what was just promoted via the review pane's own floor picker. In exactly the scenario this pane exists for — promoting a candidate for a floor no robot is currently reporting — the operator is dropped onto an unrelated floor (or "no floor reported"), with no visible evidence the promotion succeeded or which revision landed.

This is a regression from this PR: before it, onPromoted() only did state.mapKey = null; scheduleRender(); and the pane stayed open, so the note was readable.

Suggested direction: only auto-navigate when the promoted floor matches state.mapKey, or drive the map pane to the promoted site/floor instead of discarding those arguments, or surface the outcome on something that survives the pane switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant